home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / LK_V1.06.LHA / LK V1.06 / HELP / purpose.hlp < prev    next >
Encoding:
INI File  |  1994-11-01  |  5.4 KB  |  123 lines

  1. [LANGUAGE english; PARENT index; PAGE 16]
  2. [C;6;B]        The purpose of lk
  3. [J;1;N]
  4.   lk is a linker editor. It may be used to link any object all \
  5. together. Objects can be created with any language and compiler \
  6. or assembler which generate normal Amiga object files (Also \
  7. not AztecC from manx.)
  8.  
  9.   Four ways to use lk:
  10. [INDENT 7]    1. Link object files to generate an executable.
  11.     2. Link object files to generate a library (.Lib file.)
  12.     3. "Link" an executable to remove symbols and debugs and \
  13. ask for small code, data and bss hunks.
  14.        This may eventually be used to force all the program \
  15. to be loaded in a specific memory type, reshoot relocation \
  16. table from long to short, and some more.
  17.     4. Fix code, data and bss hunks to a specific address.
  18.        This is essential for people which are building games \
  19. or ROMs.
  20. [INDENT]
  21.   The first way is the first purpose of lk. When you need to \
  22. create very large programs, it will be more convenient to make \
  23. each function in a single file, and then link all object files \
  24. to generate the program.
  25.  
  26.   The second function was created to enable anyone to generate \
  27. libraries with a more convenient way than with a JOIN function \
  28. of the AmigaDOS shell. \
  29. When files pass trough lk for this purpose, lk may already \
  30. link some hunks together (This is done this way to ensure a \
  31. better linking time. Of course, only hunks which needs each \
  32. other will be linked in a single one.)
  33.  
  34.   The third way can be useful to eliminate debug and symbol hunks \
  35. from executable files. And this is possible whenever you do not \
  36. have the source object files (The future AmigaDOS loadings will \
  37. automatically be faster!)
  38.  
  39.   The forth option will be used only by people which does not \
  40. want to use AmigaDOS. This will create plain binary files \
  41. without the reloc tables because it already is positionned. \
  42. Game and ROMs are only two examples, this features might be \
  43. used for other purpose like Unix codes (Which usuly are \
  44. loaded at a fixed address.)
  45.   The debug and symbol tables are freed too.
  46.   See also the following keyword for more informations:
  47. [C;3][LINK address]        ADDRESS
  48. [J;1]
  49.   Whenever possible lk will prompt you about a bizarre object(s). \
  50. To eliminate most or all of lk warnings, see:
  51. [C;3; LINK quiet]        QUIET (Default)
  52. [LINK warninglevel]        WARNINGLEVEL
  53. [LINK nowarning]        NOWARNING
  54. [J;1]To disable the reloc32 and ref32 to generate overflow (which \
  55. should never happen, but...) use the flag:
  56. [C;3][LINK nooverflow32]    NOOVERFLOW32
  57. [J;1]
  58.   All source hunks with the same name will be linked together, \
  59. creating one hunk. Some special keywords may be used to force \
  60. other hunks to be linked together. Note that there is no  way \
  61. to avoid hunks with the same name to be appended one after \
  62. another. The given order of the source files will always be \
  63. keept inside the resulting file.
  64.   Note: most of linkers, which support a function to link hunks \
  65. together, will not check memory requirements correctly. But lk \
  66. does that for you. Anyway you may not use these functions.
  67.  
  68.   Because some compilers or assemblers does not support a way \
  69. to specify specific memory requirements, 'lk' have special \
  70. keywords for that purpose. See also:
  71. [C;3][LINK chip]        CHIP
  72. [LINK fast]            FAST
  73. [LINK public]            PUBLIC
  74. [LINK attributes]        ATTRIBUTES
  75. [LINK default]            DEFAULT
  76. [J;1]
  77.   Some symbols may be specified on the command line or into the \
  78. WITH files. This creates an internal file. Also you may receive \
  79. some errors and comments which occur with the file named: \
  80. 'Quick Defines'. See also:
  81. [C;3][LINK define]        DEFINE
  82. [J;1]
  83.   If you always have an error because some branchement and JSR/JMP \
  84. with PC generetes an overflow, you can use the instruction ALV to \
  85. enable lk to create ALV tables (Thus are table of JMP instructions.)
  86.   In the future versions, this will support more instructions, but \
  87. this will probably generate some bugs at times.
  88.   See also:
  89. [C;3][LINK alv]            ALV
  90. [J;1]
  91.   lk supports relative definitions. This is complex to properly use \
  92. those informations and be able to link objects most of the time. \
  93. lk will always try to order hunks to fit the relative requirements. \
  94. Except for tiny programs, a relative of 8 bits should be avoid or used \
  95. a very small amount of times. If you use your own offset (See OFFSET \
  96. instruction,) hunks may not be well ordered, generating overflow \
  97. errors. If no error occur, the resulting code will always be working.
  98.   The fact that lk keeps the BSS hunks at the end is important for \
  99. users which want to use XDATA, CLEARXDATA or XRELATIVE instructions.
  100.   lk will try to let BSS hunks at the end of the resulting hunk, this \
  101. may not be possible when you use short and long relatives (16 and 32 \
  102. bits.)
  103.   lk keep a BSS hunk when all relative informations point to a BSS \
  104. hunk, otherwise the hunk become a DATA hunk.
  105.   lk will link a program with relative informations pointing to a \
  106. hunk of CODE type. In this case only hunks of type code can be \
  107. pointed.
  108.   In the future versions, lk will be able to handle large d16(An) \
  109. addressing mode and transform the instruction to accept 32 bits \
  110. (Similarly the d8(An,Xn.S) will be transformed.)
  111.   See also:
  112. [C;3][LINK offset]        OFFSET
  113. [LINK xhunk]            XCODE
  114. [LINK xhunk]            XDATA
  115. [LINK xhunk]            CLEARXCODE
  116. [LINK xhunk]            CLEARXDATA
  117. [LINK xhunk]            KEEPXDATA
  118. [LINK xhunk]            XRELATIVEDATA
  119. [J;1]
  120.   A safer utilisation of lk, is to run it with a destination file \
  121. in your RAM: disk.  Because this is the first version, it may \
  122. remains a big bug (Even I tryed it in a lot of ways...)
  123.